// packageA/shareRecord/shareRecords.js
import  { inviteDetail } from "../../common/api/share";
import dayjs from 'dayjs';
Page({

  /**
   * 页面的初始数据
   */
  data: {
    id:'',
    recordsData:[]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      id:options.id
    })
    this.getDetail();
  },

  async getDetail(){
    let res = await inviteDetail({
      userId : this.data.id
    });
    res.map((v)=>{
      v.createTime = dayjs(v.createTime).format('YYYY-MM-DD HH:mm:ss')
    })
    this.setData({
      recordsData:res
    })
  },
})